package controller;
import entity.Content;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.ContentService;
@WebServlet(urlPatterns = {"/ContentListServlet"})
public class ContentList extends HttpServlet{
    ContentService contentService=new ContentService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String brandId=req.getParameter("brandId");
        List<Content> contentList = contentService.selectContentByBrandId(Integer.parseInt(brandId));
        req.setAttribute("contentList",contentList);
        req.getRequestDispatcher("content-list.jsp").forward(req, resp);
        
    }
    
    
}
